package com.model;

import java.io.Serializable;

import com.common.ReturnCode;

import lombok.Data;

@Data
public class ReponseDto<T> implements Serializable {
    /**
     * 
     */
    private static final long serialVersionUID = 1L;
    private String code;
    private String msg;
    private T data;

    public ReponseDto() {
        this.code = ReturnCode.SUCCESS.getCode();
        this.msg = ReturnCode.SUCCESS.getMsg();
    }

    public ReponseDto(ReturnCode rc) {
        this.code = rc.getCode();
        this.msg = rc.getMsg();
    }

    public ReponseDto(String code, String msg) {
        this.code = code;
        this.msg = msg;
    }

    public ReponseDto(T data) {
        this.code = ReturnCode.SUCCESS.getCode();
        this.msg = ReturnCode.SUCCESS.getMsg();
        this.data = data;
    }
}
